package com.hangjiang.gulidear.model;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * Configissue entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "configissue", catalog = "sqm")
public class ConfigIssue extends BaseEntity {

	// Fields

	private String issueId;
	private Project project;
	private User user;
	private ConfigItem configitem;
	private Timestamp reportTime;
	private Integer status;
	private Integer isDelete;
	private Set<Task> tasks = new HashSet<Task>(0);
	private Set<IssueEvalue> issueevalues = new HashSet<IssueEvalue>(0);

	// Constructors

	/** default constructor */
	public ConfigIssue() {
	}

	/** full constructor */
	public ConfigIssue(Project project, User user, ConfigItem configitem,
			Timestamp reportTime, Integer status, Integer isDelete) {
		this.project = project;
		this.user = user;
		this.configitem = configitem;
		this.reportTime = reportTime;
		this.status = status;
		this.isDelete = isDelete;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "issueId", unique = true, nullable = false, length = 32)
	public String getIssueId() {
		return this.issueId;
	}

	public void setIssueId(String issueId) {
		this.issueId = issueId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "projId")
	public Project getProject() {
		return this.project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "configId")
	public ConfigItem getConfigitem() {
		return this.configitem;
	}

	public void setConfigitem(ConfigItem configitem) {
		this.configitem = configitem;
	}

	@Column(name = "reportTime", length = 0)
	public Timestamp getReportTime() {
		return this.reportTime;
	}

	public void setReportTime(Timestamp reportTime) {
		this.reportTime = reportTime;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "isDelete")
	public Integer getIsDelete() {
		return this.isDelete;
	}

	public void setIsDelete(Integer isDelete) {
		this.isDelete = isDelete;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "configissue")
	public Set<Task> getTasks() {
		return this.tasks;
	}

	public void setTasks(Set<Task> tasks) {
		this.tasks = tasks;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "configissue")
	public Set<IssueEvalue> getIssueevalues() {
		return this.issueevalues;
	}

	public void setIssueevalues(Set<IssueEvalue> issueevalues) {
		this.issueevalues = issueevalues;
	}

}